cmake_minimum_required(VERSION 3.20)
project(status_server)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_BUILD_TYPE Release)

find_package(Boost REQUIRED)
find_package(protobuf CONFIG REQUIRED)
find_package(gRPC CONFIG REQUIRED)

include_directories(${PROJECT_SOURCE_DIR}/include)
file(GLOB SRC_CPP ${PROJECT_SOURCE_DIR}/src/*.cpp)
file(GLOB SRC_CC ${PROJECT_SOURCE_DIR}/src/*.cc)

add_executable(${PROJECT_NAME} ${SRC_CPP} ${SRC_CC} main.cpp)

target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
target_link_libraries(${PROJECT_NAME} /usr/local/lib/libjsoncpp.a)
target_link_libraries(${PROJECT_NAME} gRPC::grpc++ protobuf::libprotobuf protobuf::libprotoc)
target_link_libraries(${PROJECT_NAME} /usr/local/lib/libhiredis.so)
target_link_libraries(${PROJECT_NAME} /usr/local/lib/libmysqlcppconn.so)